#ifndef GAMEMEMORYPOOL_HEAD_H
#define GAMEMEMORYPOOL_HEAD_H

#include "Singleton.h"
#include "TThread.h"
#include "TMemoryPoolInterface.h"
#include "Player.h"
//#include "../THandler.h"

class GameMemoryPool: public Singleton<GameMemoryPool>
{
	typedef TClassPool<Player  >			PlayerPool;

public:
	GameMemoryPool(){}
	virtual ~GameMemoryPool(){}
public:
	bool init( int player_pool ){
		return m_player_memory_pool.init( player_pool , player_pool );
	}
	Player * mallocPlayerClass(){
		return new Player();
		//return (Player *)m_player_memory_pool.allocate();
	}
	void freePlayerClass( Player * obj ){
		delete obj;
		return;
		//m_player_memory_pool.free( obj ) ;
	}
	
	void destroy(){
		m_player_memory_pool.destroy();
	}
private:
	PlayerPool	m_player_memory_pool;
};

#endif